{% extends "base.html" %}
{% load staticfiles %}
{% block title %} 消费记录 {% endblock %}
{% block css %}
	{% include "common/_stylesheets.html" %}
{% endblock %}

{% block content %}
<div class="">
    <div class="page-title">
      <div class="title_left">
        <h3> 添加消费记录 </h3>
      </div>
    </div>
    <div class="clearfix"></div>
    <div class="row">
      <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
          <div class="x_title">
            <h2> 添加消费记录 <!-- <small>different form elements</small> --></h2>
            <ul class="nav navbar-right">
	            <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
	            </li>
	        </ul>
            <div class="clearfix"></div>
          </div>
          <div class="x_content">
            <br />
            {% if request.session.usertype == 1 %}
            <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left"  action="{% url 'consumption_add' %}" method="post">
				{% csrf_token %}
			  <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="project_id"> 项目id <span class="required">*</span>
                </label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                  <input type="text" id="project_id" name="project_id" required="required" value="{{ project_id }}" readonly  class="form-control col-md-7 col-xs-12">
                </div>
              </div>
              <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="project_name"> 项目名称 <span class="required">*</span>
                </label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                  <input type="text" id="project_name" name="project_name" required="required" value="{{ project_name }}" readonly  class="form-control col-md-7 col-xs-12">
                </div>
              </div>
              <div class="form-group">
                <label for="cpu_use_count" class="control-label col-md-3 col-sm-3 col-xs-12">cpu使用量 <span class="required">*</span></label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                  <input type="text" id="cpu_use_count" class="form-control col-md-7 col-xs-12" readonly value="{{ count.cpu }}" required="required"  name="cpu_use_count">
                </div>
              </div>
                 <div class="form-group">
                <label for="cpu_price" class="control-label col-md-3 col-sm-3 col-xs-12">cpu单价 <span class="required">*</span></label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                  <input  id="cpu_price" class="form-control col-md-7 col-xs-12" readonly value="{{ cpuPrice }}" required="required"  name="cpu_price" />
                </div>
              </div>
               <div class="form-group">
                <label for="disk_use_count" class="control-label col-md-3 col-sm-3 col-xs-12">磁盘使用量 <span class="required">*</span></label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                  <input type="text" id="disk_use_count" class="form-control col-md-7 col-xs-12" value="{{ count.disk }}" required="required"  name="disk_use_count">
                </div>
              </div>
                 <div class="form-group">
                <label for="disk_price" class="control-label col-md-3 col-sm-3 col-xs-12">磁盘使用单价 <span class="required">*</span></label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                  <input  id="disk_price" class="form-control col-md-7 col-xs-12" value="{{ diskPrice }}" required="required"  name="disk_price" />
                </div>
              </div>
              <div class="form-group">
                <label for="memory_use_count" class="control-label col-md-3 col-sm-3 col-xs-12">内存使用量 <span class="required">*</span></label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                  <input type="text" id="memory_use_count" class="form-control col-md-7 col-xs-12" value="{{ count.memory  }}" required="required"  name="memory_use_count">
                </div>
              </div>
              <div class="form-group">
                <label for="memory_price" class="control-label col-md-3 col-sm-3 col-xs-12">内存使用单价 <span class="required">*</span></label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                  <input  id="memory_price" class="form-control col-md-7 col-xs-12" value="{{ memoryPrice }}" required="required"  name="memory_price" />
                </div>
              </div>
              <div class="ln_solid"></div>
              <div class="form-group">
                <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                    <button class="btn btn-primary" type="button" onClick="javascript:history.go(-1)">取消</button>
                    <button type="submit" class="btn btn-success">确认</button>
                </div>
              </div>
            </form>
             {% else %}
             	权限不通过
             {% endif %}
          </div>
        </div>
      </div>
    </div>
</div>
{% endblock  %}
{% block js %} 
	{% include "common/_js.html" %}
{% endblock %}